home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / ewl / ewl_grid.h < prev    next >
C/C++ Source or Header  |  2006-01-09  |  3KB  |  105 lines

  1. #ifndef __EWL_GRID_H__
  2. #define __EWL_GRID_H__
  3.  
  4. /**
  5.  * @file ewl_grid.h
  6.  *
  7.  * @defgroup Ewl_Grid Grid The ewl grid widget
  8.  * @brief The Ewl Grid widget
  9.  * @{
  10.  */
  11.  
  12. /**
  13.  * @themekey /grid/file
  14.  * @themekey /grid/group
  15.  */
  16.  
  17. typedef struct Ewl_Grid_Info Ewl_Grid_Info;
  18.  
  19. struct Ewl_Grid_Info
  20. {
  21.     int             override;
  22.     int             size;
  23.     Ewl_Widget     *max;
  24.     Ecore_List       *cross;
  25. };
  26.  
  27. typedef struct _ewl_grid Ewl_Grid;
  28.  
  29. #define EWL_GRID(grid) ((Ewl_Grid *)grid)
  30.  
  31. struct _ewl_grid {
  32.     Ewl_Container   container;
  33.  
  34.     /*
  35.      * horisontal/vertical size of the columns and rows
  36.      */
  37.     Ewl_Grid_Info  *col_size;
  38.     Ewl_Grid_Info  *row_size;
  39.  
  40.     int             rows, cols;
  41.  
  42.     /*
  43.      * Flag indicating space assignment 
  44.          */
  45.     unsigned int    homogeneous_h;   /** Horizontal homogeneous flag */
  46.     unsigned int    homogeneous_v;   /** Vertical homogeneous flag */ 
  47.     /*
  48.      * total size of the grid widget
  49.      */
  50.     int             grid_h;
  51.     int             grid_w;
  52.  
  53.     /*
  54.      * list of old children after a reset call
  55.      */
  56.     Ecore_List       *rchildren;
  57. };
  58.  
  59.  
  60. typedef struct _ewl_grid_child Ewl_Grid_Child;
  61. struct _ewl_grid_child
  62. {
  63.     int             start_col;
  64.     int             start_row;
  65.  
  66.     int             end_col;
  67.     int             end_row;
  68. };
  69.  
  70. Ewl_Widget     *ewl_grid_new(int cols, int rows);
  71. int             ewl_grid_init(Ewl_Grid *g, int cols, int rows);
  72.  
  73. void            ewl_grid_add(Ewl_Grid *g, Ewl_Widget *w,
  74.                  int start_col, int end_col, int start_row,
  75.                  int end_row);
  76.  
  77. void            ewl_grid_col_w_set(Ewl_Grid *g, int col, int width);
  78. void            ewl_grid_row_h_set(Ewl_Grid *g, int row, int height);
  79.  
  80. void            ewl_grid_col_w_get(Ewl_Grid *g, int col, int *width);
  81. void            ewl_grid_row_h_get(Ewl_Grid *g, int row, int *height);
  82.  
  83. void            ewl_grid_reset(Ewl_Grid *g, int rows, int cols);
  84.  
  85. void        ewl_grid_homogeneous_set(Ewl_Grid *g, unsigned int h);
  86. void        ewl_grid_hhomogeneous_set(Ewl_Grid *g, unsigned int h);
  87. void        ewl_grid_vhomogeneous_set(Ewl_Grid *g, unsigned int h);
  88. unsigned int    ewl_grid_hhomogeneous_get(Ewl_Grid *g);
  89. unsigned int     ewl_grid_vhomogeneous_get(Ewl_Grid *g);
  90.  
  91. /*
  92.  * Internally used callbacks, override at your own risk.
  93.  */
  94. void ewl_grid_realize_cb(Ewl_Widget *w, void *ev_data, void *user_data);
  95. void ewl_grid_configure_cb(Ewl_Widget *w, void *ev_data, void *user_data);
  96. void ewl_grid_child_show_cb(Ewl_Container *p, Ewl_Widget *c);
  97. void ewl_grid_child_resize_cb(Ewl_Container *p, Ewl_Widget *child,
  98.                  int size, Ewl_Orientation o);
  99.  
  100. /**
  101.  * @}
  102.  */
  103.  
  104. #endif                /* __EWL_GRID_H__ */
  105.